cmake build system: visiblity support for clang
[supercollider.git] / Help / UGens / Synth control / Demand Rate / Drand.html
blob32d0c339123e14bb9029f591ed6a1b82320dea11
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="824.44">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #982316}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
15 span.s1 {font: 18.0px Helvetica}
16 span.s2 {color: #0000ff}
17 span.s3 {font: 12.0px Helvetica; color: #000000}
18 span.s4 {color: #0025b2}
19 span.Apple-tab-span {white-space:pre}
20 </style>
21 </head>
22 <body>
23 <p class="p1"><span class="s1"><b>Drand, Dxrand<span class="Apple-tab-span"> </span></b></span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b> demand rate random sequence generators</b></p>
24 <p class="p2"><br></p>
25 <p class="p1">superclass: ListDUGen</p>
26 <p class="p2"><br></p>
27 <p class="p2"><br></p>
28 <p class="p1"><span class="Apple-tab-span"> </span><b>*new(array, length)</b></p>
29 <p class="p2"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
30 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>array</b><span class="Apple-tab-span"> </span>array of values or other ugens</p>
31 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>length</b><span class="Apple-tab-span"> </span>number of values to return</p>
32 <p class="p2"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
33 <p class="p1"><span class="Apple-tab-span"> </span>structurally related: <a href="../../../Streams-Patterns-Events/Patterns/Prand.html"><span class="s2"><b><i>Prand</i></b></span></a></p>
34 <p class="p1"><b><i><span class="Apple-tab-span"> </span></i></b>see also: <a href="Demand.html"><span class="s2"><b>Demand</b></span></a><span class="Apple-tab-span"> </span></p>
35 <p class="p2"><span class="Apple-tab-span"> </span></p>
36 <p class="p1"><span class="Apple-tab-span"> </span>Dxrand never plays the same value twice, whereas Drand chooses any value in the list</p>
37 <p class="p2"><span class="Apple-tab-span"> </span></p>
38 <p class="p3"><span class="s3"><span class="Apple-tab-span"> </span></span>// example</p>
39 <p class="p4"><span class="Apple-tab-span"> </span></p>
40 <p class="p5"><span class="Apple-tab-span"> </span>(</p>
41 <p class="p5"><span class="Apple-tab-span"> </span>{<span class="Apple-converted-space"> </span></p>
42 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">var</span> a, freq, trig;</p>
43 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a = <span class="s4">Drand</span>([1, 3, 2, 7, 8], <span class="s4">inf</span>);</p>
44 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>trig = <span class="s4">Impulse</span>.kr(<span class="s4">MouseX</span>.kr(1, 400, 1));</p>
45 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>freq = <span class="s4">Demand</span>.kr(trig, 0, a) * 30 + 340;<span class="Apple-converted-space"> </span></p>
46 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">SinOsc</span>.ar(freq) * 0.1</p>
47 <p class="p4"><span class="Apple-tab-span"> </span></p>
48 <p class="p5"><span class="Apple-tab-span"> </span>}.play;</p>
49 <p class="p5"><span class="Apple-tab-span"> </span>)</p>
50 <p class="p4"><span class="Apple-tab-span"> </span></p>
51 <p class="p5"><span class="Apple-tab-span"> </span>(</p>
52 <p class="p5"><span class="Apple-tab-span"> </span>{<span class="Apple-converted-space"> </span></p>
53 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">var</span> a, freq, trig;</p>
54 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a = <span class="s4">Dxrand</span>([1, 3, 2, 7, 8], <span class="s4">inf</span>);</p>
55 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>trig = <span class="s4">Impulse</span>.kr(<span class="s4">MouseX</span>.kr(1, 400, 1));</p>
56 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>freq = <span class="s4">Demand</span>.kr(trig, 0, a) * 30 + 340;<span class="Apple-converted-space"> </span></p>
57 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">SinOsc</span>.ar(freq) * 0.1</p>
58 <p class="p4"><span class="Apple-tab-span"> </span></p>
59 <p class="p5"><span class="Apple-tab-span"> </span>}.play;</p>
60 <p class="p5"><span class="Apple-tab-span"> </span>)</p>
61 <p class="p4"><span class="Apple-tab-span"> </span></p>
62 <p class="p4"><span class="Apple-tab-span"> </span></p>
63 <p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
64 <p class="p4"><span class="Apple-tab-span"> </span></p>
65 <p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
66 <p class="p4"><span class="Apple-tab-span"> </span></p>
67 <p class="p4"><span class="Apple-tab-span"> </span></p>
68 </body>
69 </html>